/*
 * Copyright (C) 2011-2012 Andrew Wells
 *
 * Licensed under the GNU License, Version 3
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.gnu.org/copyleft/gpl.html
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 * Dungeons & Dragons Copyright (C) Wizards of the Coast. I do not claim
 * the right to any information used from their books or resources.
 */

package com.trace.wells.charactertracker;

public class ConstantHelper {

	//TODO: Create system to separately load the characters for each file 

	public static final String FILENAME = "data/data/com.trace.wells.charactertracker/characters.txt";
	public static final String FILE_DIRECTORY = "data/data/com.trace.wells.charactertracker/";
	public static final String CHARACTER_LIST_FILE = "data/data/com.trace.wells.charactertracker/characterArraylist.txt";

	public static final int REQUEST_CODE_BATTLE_SCREEN = 1;
	public static final int REQUEST_CODE_CREATE_CHARACTER = 2;
	public static final int REQUEST_CODE_PREPARE_SPELLS = 3;

	public static final int DISPLAY_MODE_ITEMS = 0;
	public static final int DISPLAY_MODE_BATTLE_SCREEN = 1;
	public static final int DISPLAY_MODE_SPELLS = 2;
	public static final int DISPLAY_MODE_WEAPONS = 3;

	//Constant helperIDs for menu Buttons
	public static final int MENU_BUTTON_SPELLS = 1;
	public static final int MENU_BUTTON_RESET_SPELLS = 2;
	public static final int MENU_BUTTON_PREPARE_SPELLS = 3;
	public static final int MENU_BUTTON_ADD_WEAPON = 4;
	public static final int MENU_BUTTON_WEAPONS = 5;
	public static final int MENU_BUTTON_ADD_SPELL = 6;
	public static final int MENU_BUTTON_ADJUST_STATS = 7;
	public static final int MENU_BUTTON_REST = 8;
	public static final int MENU_BUTTON_ITEMS = 9;
	public static final int MENU_BUTTON_ADD_ITEM = 10;
	public static final int MENU_BUTTON_CHAR_CARD = 11;
	public static final int MENU_BUTTON_EXPAND = 12;
	public static final int MENU_BUTTON_CONTRACT = 13;
	public static final int MENU_BUTTON_REMOVE_ALL_SPELLS = 14;

	//Item Types
	public static final int ITEM_TYPE_POTION = 0;
	public static final int ITEM_TYPE_RING = 1;
	public static final int ITEM_TYPE_WAND = 2;
	public static final int ITEM_TYPE_STAFF = 3;
	public static final int ITEM_TYPE_SCROLL = 4;
	public static final int ITEM_TYPE_ROD = 5;
	public static final int ITEM_TYPE_MISC = 6;

	public static final String ITEM_TYPE_POTION_STRING = "Potion";
	public static final String ITEM_TYPE_RING_STRING = "Ring";
	public static final String ITEM_TYPE_WAND_STRING = "Wand";
	public static final String ITEM_TYPE_STAFF_STRING = "Staff";
	public static final String ITEM_TYPE_SCROLL_STRING = "Scroll";
	public static final String ITEM_TYPE_ROD_STRING = "Rod";
	public static final String ITEM_TYPE_MISC_STRING = "Misc";

	//The max 
	public static final int NUMBER_OF_ITEM_TYPES_MAX = 8;

	//Static variables for the character's abilities
	public static final int STR = 0;
	public static final int DEX = 1;
	public static final int CON = 2;
	public static final int INT = 3;
	public static final int WIS = 4;
	public static final int CHA = 5;

	//The constant value for referencing the correct saving throw modifiers
	public static final int SAVING_THROW_FORTITUDE = 1;
	public static final int SAVING_THROW_REFLEX = 2;
	public static final int SAVING_THROW_WILL = 3;

	//The Bonus Save types used in CharacterClass bonusTable save generation
	public static final int BONUS_SAVE_TYPE_GOOD = 2;
	public static final int BONUS_SAVE_TYPE_POOR = 3;

	private static int LEVEL_MAX = 21;

	//To be used when setting a character's BattleScreen settings
	//For fighters and other non-magic classes
	public static final int CHAR_TYPE_NO_MAGIC = 0;

	//For wizards, monks, clerics etc...
	//They choose their spells per day from a list of spells
	public static final int CHAR_TYPE_NORMAL_MAGIC = 1;

	//Where Wizards they must select new spells every day, Sorcerers
	//must memorize their spells and can not change them
	public static final int CHAR_TYPE_SPECIAL_MAGIC = 2;

	//Applies to both types of magic casting
	public static final int CHAR_TYPE_BOTH_TYPES_MAGIC = 3;

	public static final int CHAR_TYPE_MAGIC = 4;

	//For the Spell class to determine if the Sorcerer's spell is currently active
	public static int SPELL_IS_ACTIVE = 1;
	public static int SPELL_IS_INACTIVE = 0;

	public static final String RACE_HUMAN = "Human";
	public static final String RACE_DWARF = "Dwarf";
	public static final String RACE_ELF = "Elf";
	public static final String RACE_GNOME = "Gnome";
	public static final String RACE_HALFLING = "Halfling";
	public static final String RACE_HALF_ELF = "Half-elf";
	public static final String RACE_HALF_ORC = "Half-orc";

	public static final String CLASS_BARBARIAN = "Barbarian";
	public static final String CLASS_BARD = "Bard";
	public static final String CLASS_CLERIC = "Cleric";
	public static final String CLASS_DRUID = "Druid";
	public static final String CLASS_FIGHTER = "Fighter";
	public static final String CLASS_MONK = "Monk";
	public static final String CLASS_PALADIN = "Paladin";
	public static final String CLASS_RANGER = "Ranger";
	public static final String CLASS_ROGUE = "Rogue";
	public static final String CLASS_SORCERER = "Sorcerer";
	public static final String CLASS_WIZARD = "Wizard";

	public static final String CLASS_ABV_BARD = "Brd";
	public static final String CLASS_ABV_CLERIC = "Clr";
	public static final String CLASS_ABV_DRUID = "Drd";
	public static final String CLASS_ABV_PALADIN = "Pal";
	public static final String CLASS_ABV_RANGER = "Rgr";
	public static final String CLASS_ABV_SORWIZ = "Sor/Wiz";

	public static final int CLASS_NUMBER_BARBARIAN = 0;
	public static final int CLASS_NUMBER_BARD = 1;
	public static final int CLASS_NUMBER_CLERIC = 2;
	public static final int CLASS_NUMBER_DRUID = 3;
	public static final int CLASS_NUMBER_FIGHTER = 4;
	public static final int CLASS_NUMBER_MONK = 5;
	public static final int CLASS_NUMBER_PALADIN = 6;
	public static final int CLASS_NUMBER_RANGER = 7;
	public static final int CLASS_NUMBER_ROGUE = 8;
	public static final int CLASS_NUMBER_SORCERER = 9;
	public static final int CLASS_NUMBER_WIZARD = 10;

	public static final String[] classNameStringArray = { "Barbarian", "Bard", "Cleric", "Druid", "Fighter", "Monk", "Paladin", "Ranger", "Rogue", "Sorcerer", "Wizard" };

	// The number of classes
	public static final int CLASS_NUMBER_MAX = 11;
	// The number of spell levels
	public static final int SPELL_LEVEL_MAX = 10;

	//
	public static final int[][] CLASS_BASE_SAVING_THROWS = { { 1, 0, 0 }, { 0, 1, 1 }, { 1, 0, 1 }, { 1, 0, 1 }, { 1, 0, 0 }, { 1, 1, 1 }, { 1, 0, 0 }, { 1, 1, 0 }, { 0, 1, 0 }, { 0, 0, 1 }, { 0, 0, 1 } };

	public static final int[] CLASS_BASE_ATTACK_BONUSES = { 2, 1, 1, 1, 2, 1, 2, 2, 1, 0, 0 };

	public static String getClassNameAbreviation(int classNumberRepresentation) {
		String returnValue;
		switch (classNumberRepresentation) {
		case 1:
			returnValue = CLASS_ABV_BARD;
			break;
		case 2:
			returnValue = CLASS_ABV_CLERIC;
			break;
		case 3:
			returnValue = CLASS_ABV_DRUID;
			break;
		case 6:
			returnValue = CLASS_ABV_PALADIN;
			break;
		case 7:
			returnValue = CLASS_ABV_RANGER;
			break;
		case 9:
			returnValue = CLASS_ABV_SORWIZ;
			break;
		case 10:
			returnValue = CLASS_ABV_SORWIZ;
			break;
		default:
			returnValue = "";
		}

		return returnValue;
	}

	public static int classStringToClassInt(String charClass) {
		int classInt;
		if (charClass.equals(ConstantHelper.CLASS_BARBARIAN)) {
			classInt = 0;
		} else if (charClass.equals(ConstantHelper.CLASS_BARD)) {
			classInt = 1;
		} else if (charClass.equals(ConstantHelper.CLASS_CLERIC)) {
			classInt = 2;
		} else if (charClass.equals(ConstantHelper.CLASS_DRUID)) {
			classInt = 3;
		} else if (charClass.equals(ConstantHelper.CLASS_FIGHTER)) {
			classInt = 4;
		} else if (charClass.equals(ConstantHelper.CLASS_MONK)) {
			classInt = 5;
		} else if (charClass.equals(ConstantHelper.CLASS_PALADIN)) {
			classInt = 6;
		} else if (charClass.equals(ConstantHelper.CLASS_RANGER)) {
			classInt = 7;
		} else if (charClass.equals(ConstantHelper.CLASS_ROGUE)) {
			classInt = 8;
		} else if (charClass.equals(ConstantHelper.CLASS_SORCERER)) {
			classInt = 9;
		} else if (charClass.equals(ConstantHelper.CLASS_WIZARD)) {
			classInt = 10;
		} else
			classInt = -1;
		return classInt;
	}

	public static String classIntToString(int charClass) {
		String classString;
		if (charClass == ConstantHelper.CLASS_NUMBER_BARBARIAN) {
			classString = ConstantHelper.CLASS_BARBARIAN;
		} else if (charClass == ConstantHelper.CLASS_NUMBER_BARD) {
			classString = ConstantHelper.CLASS_BARD;
		} else if (charClass == ConstantHelper.CLASS_NUMBER_CLERIC) {
			classString = ConstantHelper.CLASS_CLERIC;
		} else if (charClass == ConstantHelper.CLASS_NUMBER_DRUID) {
			classString = ConstantHelper.CLASS_DRUID;
		} else if (charClass == ConstantHelper.CLASS_NUMBER_FIGHTER) {
			classString = ConstantHelper.CLASS_FIGHTER;
		} else if (charClass == ConstantHelper.CLASS_NUMBER_MONK) {
			classString = ConstantHelper.CLASS_MONK;
		} else if (charClass == ConstantHelper.CLASS_NUMBER_PALADIN) {
			classString = ConstantHelper.CLASS_PALADIN;
		} else if (charClass == ConstantHelper.CLASS_NUMBER_RANGER) {
			classString = ConstantHelper.CLASS_RANGER;
		} else if (charClass == ConstantHelper.CLASS_NUMBER_ROGUE) {
			classString = ConstantHelper.CLASS_ROGUE;
		} else if (charClass == ConstantHelper.CLASS_NUMBER_SORCERER) {
			classString = ConstantHelper.CLASS_SORCERER;
		} else if (charClass == ConstantHelper.CLASS_NUMBER_WIZARD) {
			classString = ConstantHelper.CLASS_WIZARD;
		} else
			classString = "";
		return classString;
	}

	/*
	 * 	//Item Types
	public static final int ITEM_TYPE_POTION = 0;
	public static final int ITEM_TYPE_RING = 1;
	public static final int ITEM_TYPE_WAND = 2;
	public static final int ITEM_TYPE_STAFF = 3;
	public static final int ITEM_TYPE_SCROLL = 4;
	public static final int ITEM_TYPE_ROD = 5;
	public static final int ITEM_TYPE_MISC = 6;
	 */

	public static int convertItemTypeStringToInteger(String itemType) {
		int returnValue = -1;
		if (itemType.equalsIgnoreCase(ITEM_TYPE_POTION_STRING))
			returnValue = 0;
		else if (itemType.equalsIgnoreCase(ITEM_TYPE_RING_STRING))
			returnValue = 1;
		else if (itemType.equalsIgnoreCase(ITEM_TYPE_WAND_STRING))
			returnValue = 2;
		else if (itemType.equalsIgnoreCase(ITEM_TYPE_STAFF_STRING))
			returnValue = 3;
		else if (itemType.equalsIgnoreCase(ITEM_TYPE_SCROLL_STRING))
			returnValue = 4;
		else if (itemType.equalsIgnoreCase(ITEM_TYPE_ROD_STRING))
			returnValue = 5;
		else if (itemType.equalsIgnoreCase(ITEM_TYPE_MISC_STRING))
			returnValue = 6;
		else
			;
		return returnValue;
	}

	// Generates a table based on the parameters passed. 1 = high, 0 = low
	public static int[][] generateBaseSavingThrowsTable(int[] savingThrowStatusArray) {
		// The counter determining when the number increases
		int[] modAmount = { 0, 0, 0 };
		for (int i = 0; i < modAmount.length; i++) {
			if (savingThrowStatusArray[i] == 1)
				modAmount[i] = 2;
			else
				modAmount[i] = 3;
		}

		// This sets up the returning array (saving throws table)
		int[][] savingThrowArray = new int[3][21];

		// Loop thorugh each saving throw element in the table to be generated
		for (int i = 0; i < savingThrowStatusArray.length; i++) {
			int bomusAmountCounter = savingThrowStatusArray[i] * 2;
			for (int j = 1; j < 21; j++) {
				if (j == 1) {
					// If the current save is high...
					if (savingThrowStatusArray[i] == 1)
						savingThrowArray[i][j] = 2;
					else {
						savingThrowArray[i][j] = 0;
					}
				} else {
					if (j % modAmount[i] == 0) {
						bomusAmountCounter++;
						savingThrowArray[i][j] = bomusAmountCounter;
					} else
						savingThrowArray[i][j] = bomusAmountCounter;
				}
			}
		}
		return savingThrowArray;
	}

	//This function should return the Base attack bonus array for a 
	public static int[] generateBaseAttackBonusArray(int baseAttackBonusSkill) {
		int[] baseAttackBonusArray = new int[LEVEL_MAX];
		// Good
		if (baseAttackBonusSkill == 2)
			for (int i = 1; i < LEVEL_MAX; i++) {
				baseAttackBonusArray[i] = i;
			}
		else if (baseAttackBonusSkill == 1) {
			// The counter to determine if the BAB should stay the same
			int mod = 4;
			int baseAttackBonusValue = 0;
			for (int i = 1; i < LEVEL_MAX; i++) {

				if ((i - 1) % mod == 0) {
					baseAttackBonusArray[i] = baseAttackBonusValue;
				} else {
					baseAttackBonusValue++;
					baseAttackBonusArray[i] = baseAttackBonusValue;
				}
			}
		} else {
			int mod = 2;
			int baseAttackBonusValue = 0;
			for (int i = 1; i < LEVEL_MAX; i++) {
				if (i % mod == 0) {
					baseAttackBonusArray[i] = baseAttackBonusValue;
				} else {
					baseAttackBonusArray[i] = baseAttackBonusValue;
					baseAttackBonusValue++;
				}
			}
		}
		return baseAttackBonusArray;
	}

	public static final int[][] SPELL_DAY_BARD = new int[][] {
			{ 0, 0, 0, 0, 0, 0, 0 },

			//1st Level
			{ 2, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, { 3, 0, -1, -1, -1, -1, -1, -1, -1, -1 }, { 3, 1, -1, -1, -1, -1, -1, -1, -1, -1 }, { 3, 2, 0, -1, -1, -1, -1, -1, -1, -1 },
			{ 3, 3, 1, -1, -1, -1, -1, -1, -1, -1 }, { 3, 3, 2, -1, -1, -1, -1, -1, -1, -1 }, { 3, 3, 2, 0, -1, -1, -1, -1, -1, -1 }, { 3, 3, 3, 1, -1, -1, -1, -1, -1, -1 }, { 3, 3, 3, 2, -1, -1, -1, -1, -1, -1 },
			{ 3, 3, 3, 2, 0, -1, -1, -1, -1, -1 }, { 3, 3, 3, 3, 1, -1, -1, -1, -1, -1 }, { 3, 3, 3, 3, 2, -1, -1, -1, -1, -1 }, { 3, 3, 3, 3, 2, 0, -1, -1, -1, -1 }, { 4, 3, 3, 3, 3, 1, -1, -1, -1, -1 },
			{ 4, 4, 3, 3, 3, 2, -1, -1, -1, -1 }, { 4, 4, 4, 3, 3, 2, 0, -1, -1, -1 }, { 4, 4, 4, 4, 3, 3, 1, -1, -1, -1 }, { 4, 4, 4, 4, 4, 3, 2, -1, -1, -1 }, { 4, 4, 4, 4, 4, 4, 3, -1, -1, -1 },
			{ 4, 4, 4, 4, 4, 4, 4, -1, -1, -1 } };

	public static final int[][] SPELLS_KNOWN_BARD = new int[][] {
			{ 0, 0, 0, 0, 0, 0, 0 },

			//1st Level
			{ 4, 0, 0, 0, 0, 0, 0 }, { 5, 0, 0, 0, 0, 0, 0 }, { 6, 3, 0, 0, 0, 0, 0 }, { 6, 3, 0, 0, 0, 0, 0 }, { 6, 4, 3, 0, 0, 0, 0 }, { 6, 4, 3, 0, 0, 0, 0 }, { 6, 4, 4, 0, 0, 0, 0 }, { 6, 4, 4, 3, 0, 0, 0 },
			{ 6, 4, 4, 3, 0, 0, 0 }, { 6, 4, 4, 4, 0, 0, 0 }, { 6, 4, 4, 4, 3, 0, 0 }, { 6, 4, 4, 4, 3, 0, 0 }, { 6, 4, 4, 4, 4, 0, 0 }, { 6, 4, 4, 4, 4, 3, 0 }, { 6, 4, 4, 4, 4, 3, 0 }, { 6, 5, 4, 4, 4, 4, 0 },
			{ 6, 5, 5, 4, 4, 4, 3 }, { 6, 5, 5, 5, 4, 4, 3 }, { 6, 5, 5, 5, 5, 4, 4 }, { 6, 5, 5, 5, 5, 5, 4 } };

	//	public static final int[][] SPELL_DAY_CLERIC_NO_DOMAIN = new int[][] {
	//			{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
	//
	//			//1st Level
	//			{ 3, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, { 4, 2, 0, 0, 0, 0, 0, 0, 0, 0 }, { 4, 2, 1, 0, 0, 0, 0, 0, 0, 0 }, { 5, 3, 2, 0, 0, 0, 0, 0, 0, 0 }, { 5, 3, 2, 1, 0, 0, 0, 0, 0, 0 }, { 5, 3, 3, 2, 0, 0, 0, 0, 0, 0 },
	//			{ 6, 4, 3, 2, 1, 0, 0, 0, 0, 0 }, { 6, 4, 3, 3, 2, 0, 0, 0, 0, 0 }, { 6, 4, 4, 3, 2, 1, 0, 0, 0, 0 }, { 6, 4, 4, 3, 3, 2, 0, 0, 0, 0 }, { 6, 5, 4, 4, 3, 2, 1, 0, 0, 0 }, { 6, 5, 4, 4, 3, 3, 2, 0, 0, 0 },
	//			{ 6, 5, 5, 4, 4, 3, 2, 1, 0, 0 }, { 6, 5, 5, 4, 4, 3, 3, 2, 0, 0 }, { 6, 5, 5, 5, 4, 4, 3, 2, 1, 0 }, { 6, 5, 5, 5, 4, 4, 3, 3, 2, 0 }, { 6, 5, 5, 5, 5, 4, 4, 3, 2, 1 }, { 6, 5, 5, 5, 5, 4, 4, 3, 3, 2 },
	//			{ 6, 5, 5, 5, 5, 5, 4, 4, 3, 3 }, { 6, 5, 5, 5, 5, 5, 4, 4, 4, 4 } };

	public static final int[][] SPELL_DAY_CLERIC_DOMAIN = new int[][] {
			{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },

			//1st Level
			{ 3, 2, -1, -1, -1, -1, -1, -1, -1, -1 }, { 4, 3, -1, -1, -1, -1, -1, -1, -1, -1 }, { 4, 3, 2, -1, -1, -1, -1, -1, -1, -1 }, { 5, 4, 3, -1, -1, -1, -1, -1, -1, -1 }, { 5, 4, 3, 2, -1, -1, -1, -1, -1, -1 },
			{ 5, 4, 4, 3, -1, -1, -1, -1, -1, -1 }, { 6, 5, 4, 3, 2, -1, -1, -1, -1, -1 }, { 6, 5, 4, 4, 3, -1, -1, -1, -1, -1 }, { 6, 5, 5, 4, 3, 2, -1, -1, -1, -1 }, { 6, 5, 5, 4, 4, 3, -1, -1, -1, -1 },
			{ 6, 6, 5, 5, 4, 3, 2, -1, -1, -1 }, { 6, 6, 5, 5, 4, 4, 3, -1, -1, -1 }, { 6, 6, 6, 5, 5, 4, 3, 2, -1, -1 }, { 6, 6, 6, 5, 5, 4, 4, 3, -1, -1 }, { 6, 6, 6, 6, 5, 5, 4, 3, 2, -1 },
			{ 6, 6, 6, 6, 5, 5, 4, 4, 3, -1 }, { 6, 6, 6, 6, 6, 5, 5, 4, 3, 2 }, { 6, 6, 6, 6, 6, 5, 5, 4, 4, 3 }, { 6, 6, 6, 6, 6, 6, 5, 5, 4, 4 }, { 6, 6, 6, 6, 6, 6, 5, 5, 5, 5 } };

	public static final int[][] SPELL_DAY_DRUID = new int[][] {
			{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },

			//1st Level
			{ 3, 1, -1, -1, -1, -1, -1, -1, -1, -1 }, { 4, 2, -1, -1, -1, -1, -1, -1, -1, -1 }, { 4, 2, 1, -1, -1, -1, -1, -1, -1, -1 }, { 5, 3, 2, -1, -1, -1, -1, -1, -1, -1 }, { 5, 3, 2, 1, -1, -1, -1, -1, -1, -1 },
			{ 5, 3, 3, 2, -1, -1, -1, -1, -1, -1 }, { 6, 4, 3, 2, 1, -1, -1, -1, -1, -1 }, { 6, 4, 3, 3, 2, -1, -1, -1, -1, -1 }, { 6, 4, 4, 3, 2, 1, -1, -1, -1, -1 }, { 6, 4, 4, 3, 3, 2, -1, -1, -1, -1 },
			{ 6, 5, 4, 4, 3, 2, 1, -1, -1, -1 }, { 6, 5, 4, 4, 3, 3, 2, -1, -1, -1 }, { 6, 5, 5, 4, 4, 3, 2, 1, -1, -1 }, { 6, 5, 5, 4, 4, 3, 3, 2, -1, -1 }, { 6, 5, 5, 5, 4, 4, 3, 2, 1, -1 },
			{ 6, 5, 5, 5, 4, 4, 3, 3, 2, -1 }, { 6, 5, 5, 5, 5, 4, 4, 3, 2, 1 }, { 6, 5, 5, 5, 5, 4, 4, 3, 3, 2 }, { 6, 5, 5, 5, 5, 5, 4, 4, 3, 3 }, { 6, 5, 5, 5, 5, 5, 4, 4, 4, 4 } };

	public static final int[][] SPELL_DAY_PALADIN = new int[][] {
			{ 0, 0, 0, 0 },

			//1st Level
			{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, { 0, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
			{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, { 1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, { 1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, { 1, 0, -1, -1, -1, -1, -1, -1, -1, -1 },
			{ 1, 0, -1, -1, -1, -1, -1, -1, -1, -1 }, { 1, 1, -1, -1, -1, -1, -1, -1, -1, -1 }, { 1, 1, 0, -1, -1, -1, -1, -1, -1, -1 }, { 1, 1, 1, -1, -1, -1, -1, -1, -1, -1 }, { 1, 1, 1, -1, -1, -1, -1, -1, -1, -1 },
			{ 2, 1, 1, 0, -1, -1, -1, -1, -1, -1 }, { 2, 1, 1, 1, -1, -1, -1, -1, -1, -1 }, { 2, 2, 1, 1, -1, -1, -1, -1, -1, -1 }, { 2, 2, 2, 1, -1, -1, -1, -1, -1, -1 }, { 3, 2, 2, 1, -1, -1, -1, -1, -1, -1 },
			{ 3, 3, 3, 2, -1, -1, -1, -1, -1, -1 }, { 3, 3, 3, 3, -1, -1, -1, -1, -1, -1 } };

	public static final int[][] SPELL_DAY_RANGER = new int[][] {
			{ 0, 0, 0, 0 },

			//1st Level
			{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, { 0, -1, -1, -1, -1, -1, -1, -1, -1, -1 },
			{ 0, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, { 1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, { 1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, { 1, 0, -1, -1, -1, -1, -1, -1, -1, -1 },
			{ 1, 0, -1, -1, -1, -1, -1, -1, -1, -1 }, { 1, 1, -1, -1, -1, -1, -1, -1, -1, -1 }, { 1, 1, 0, -1, -1, -1, -1, -1, -1, -1 }, { 1, 1, 1, -1, -1, -1, -1, -1, -1, -1 }, { 1, 1, 1, -1, -1, -1, -1, -1, -1, -1 },
			{ 2, 1, 1, 0, -1, -1, -1, -1, -1, -1 }, { 2, 1, 1, 1, -1, -1, -1, -1, -1, -1 }, { 2, 2, 1, 1, -1, -1, -1, -1, -1, -1 }, { 2, 2, 2, 1, -1, -1, -1, -1, -1, -1 }, { 3, 2, 2, 1, -1, -1, -1, -1, -1, -1 },
			{ 3, 3, 3, 2, -1, -1, -1, -1, -1, -1 }, { 3, 3, 3, 3, -1, -1, -1, -1, -1, -1 } };

	public static final int[][] SPELL_DAY_SORCERER = new int[][] {
			{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },

			//1st Level
			{ 5, 3, -1, -1, -1, -1, -1, -1, -1, -1 }, { 6, 4, -1, -1, -1, -1, -1, -1, -1, -1 }, { 6, 5, -1, -1, -1, -1, -1, -1, -1, -1 }, { 6, 6, 3, -1, -1, -1, -1, -1, -1, -1 }, { 6, 6, 4, -1, -1, -1, -1, -1, -1, -1 },
			{ 6, 6, 5, 3, -1, -1, -1, -1, -1, -1 }, { 6, 6, 6, 4, -1, -1, -1, -1, -1, -1 }, { 6, 6, 6, 5, 3, -1, -1, -1, -1, -1 }, { 6, 6, 6, 6, 4, -1, -1, -1, -1, -1 }, { 6, 6, 6, 6, 5, 3, -1, -1, -1, -1 },
			{ 6, 6, 6, 6, 6, 4, -1, -1, -1, -1 }, { 6, 6, 6, 6, 6, 5, 3, -1, -1, -1 }, { 6, 6, 6, 6, 6, 6, 4, -1, -1, -1 }, { 6, 6, 6, 6, 6, 6, 5, 3, -1, -1 }, { 6, 6, 6, 6, 6, 6, 6, 4, -1, -1 },
			{ 6, 6, 6, 6, 6, 6, 6, 5, 3, -1 }, { 6, 6, 6, 6, 6, 6, 6, 6, 4, -1 }, { 6, 6, 6, 6, 6, 6, 6, 6, 5, 3, }, { 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, }, { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, } };

	public static final int[][] SPELLS_KNOWN_SORCERER = new int[][] {
			{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },

			//1st Level
			{ 4, 2, 0, 0, 0, 0, 0, 0, 0, 0 }, { 5, 2, 0, 0, 0, 0, 0, 0, 0, 0 }, { 5, 3, 0, 0, 0, 0, 0, 0, 0, 0 }, { 6, 3, 1, 0, 0, 0, 0, 0, 0, 0 }, { 6, 4, 2, 0, 0, 0, 0, 0, 0, 0 }, { 7, 4, 2, 1, 0, 0, 0, 0, 0, 0 },
			{ 7, 5, 3, 2, 0, 0, 0, 0, 0, 0 }, { 8, 5, 3, 2, 1, 0, 0, 0, 0, 0 }, { 8, 5, 4, 3, 2, 0, 0, 0, 0, 0 }, { 9, 5, 4, 3, 2, 1, 0, 0, 0, 0 }, { 9, 5, 5, 4, 3, 2, 0, 0, 0, 0 }, { 9, 5, 5, 4, 3, 2, 1, 0, 0, 0 },
			{ 9, 5, 5, 4, 4, 3, 2, 0, 0, 0 }, { 9, 5, 5, 4, 4, 3, 2, 1, 0, 0 }, { 9, 5, 5, 4, 4, 4, 3, 2, 0, 0 }, { 9, 5, 5, 4, 4, 4, 3, 2, 1, 0 }, { 9, 5, 5, 4, 4, 4, 3, 3, 2, 0 }, { 9, 5, 5, 4, 4, 4, 3, 3, 2, 1 },
			{ 9, 5, 5, 4, 4, 4, 3, 3, 3, 2 }, { 9, 5, 5, 4, 4, 4, 3, 3, 3, 3 } };

	public static final int[][] SPELL_DAY_WIZARD = new int[][] {
			{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },

			//1st Level
			{ 3, 1, -1, -1, -1, -1, -1, -1, -1, -1 }, { 4, 2, -1, -1, -1, -1, -1, -1, -1, -1 }, { 4, 2, 1, -1, -1, -1, -1, -1, -1, -1 }, { 4, 3, 2, -1, -1, -1, -1, -1, -1, -1 }, { 4, 3, 2, 1, -1, -1, -1, -1, -1, -1 },
			{ 4, 3, 3, 2, -1, -1, -1, -1, -1, -1 }, { 4, 4, 3, 2, 1, -1, -1, -1, -1, -1 }, { 4, 4, 3, 3, 2, -1, -1, -1, -1, -1 }, { 4, 4, 4, 3, 2, 1, -1, -1, -1, -1 }, { 4, 4, 4, 3, 3, 2, -1, -1, -1, -1 },
			{ 4, 4, 4, 4, 3, 2, 1, -1, -1, -1 }, { 4, 4, 4, 4, 3, 3, 2, -1, -1, -1 }, { 4, 4, 4, 4, 4, 3, 2, 1, -1, -1 }, { 4, 4, 4, 4, 4, 3, 3, 2, -1, -1 }, { 4, 4, 4, 4, 4, 4, 3, 2, 1, -1 },
			{ 4, 4, 4, 4, 4, 4, 3, 3, 2, -1 }, { 4, 4, 4, 4, 4, 4, 4, 3, 2, 1 }, { 4, 4, 4, 4, 4, 4, 4, 3, 3, 2 }, { 4, 4, 4, 4, 4, 4, 4, 4, 3, 3 }, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 } };

	public static final int[][] BONUS_SPELLS = { { 0, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, { 1, -1, 1, -1, -1, -1, -1, -1, -1, -1 }, { 2, -1, 1, 1, -1, -1, -1, -1, -1, -1 }, { 3, -1, 1, 1, 1, -1, -1, -1, -1, -1 },
			{ 4, -1, 1, 1, 1, 1, -1, -1, -1, -1 }, { 5, -1, 2, 1, 1, 1, 1, -1, -1, -1 }, { 6, -1, 2, 2, 1, 1, 1, 1, -1, -1 }, { 7, -1, 2, 2, 2, 1, 1, 1, 1, -1 }, { 8, -1, 2, 2, 2, 2, 1, 1, 1, 1 },
			{ 9, -1, 3, 2, 2, 2, 2, 1, 1, 1, 1 }, { 10, -1, 3, 3, 2, 2, 2, 2, 1, 1, 1 }, { 11, -1, 3, 3, 3, 2, 2, 2, 2, 1, 1 }, { 12, -1, 3, 3, 3, 3, 2, 2, 2, 2, 1 }, { 13, -1, 4, 3, 3, 3, 3, 2, 2, 2, 2 },
			{ 14, -1, 4, 4, 3, 3, 3, 3, 2, 2, 2 }, { 15, -1, 4, 4, 4, 3, 3, 3, 3, 2, 2 }, { 16, -1, 4, 4, 4, 4, 3, 3, 3, 3, 2 }, { 17, -1, 5, 4, 4, 4, 4, 3, 3, 3, 3 } };

}
